Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: RPM package installs initscripts and systemd services #226

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

blukat29
Copy link
Contributor

@blukat29 blukat29 commented Jan 23, 2025

Proposed changes

  • kend rpm v1.0.3 had not been successfully installing on Rocky Linux 9. This PR makes rpm v2.0.0 work correctly.
  • After installing the RPM package, following commands must work:
    • SysVInit commands (requires /etc/init.d/functions and /etc/init.d/k*nd files)
      /etc/init.d/kend {start|stop|restart|status}
      
    • Systemd commands (additionally requires /etc/systemd/system/k*nd.service file)
      systemctl {start|stop|restart|status} kend
      
    • Note that /etc/init.d/kend depends on /etc/init.d/functions file. The RPM script also handles it.
  • RPM package must be correctly installed in both cases:
    • Clean install v2.0.0
    • Upgrade from v1.0.3
  • RPM package must be correctly installed on following environments:
    • CentOS stream 9
    • Rocky Linux 9

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

Test results:

CentOS stream 9, clean install v2.0.0
  • before install
     + ls -l /etc/init.d
     ls: cannot access '/etc/init.d': No such file or directory
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Jan  8 07:56 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v2.0.0
     sudo yum install kend-v2.0.0-0.el9.x86_64.rpm
     
     Installed:
       chkconfig-1.24-1.el9.x86_64    initscripts-10.11.8-4.el9.x86_64    kend-v2.0.0-0.el9.x86_64
    
     + ls -l /etc/init.d
     lrwxrwxrwx. 1 root root 11 May 23  2023 /etc/init.d -> rc.d/init.d
     + ls -l /etc/rc.d/init.d
     total 36
     -rw-r--r--. 1 root root 18220 Aug 27 11:35 functions
     -rwxr-xr--. 1 root root 10161 Jan 23 13:25 kend
     -rw-r--r--. 1 root root  1161 Jan  8 07:56 README
     + ls -l /etc/systemd/system/kend.service
     -rw-r--r--. 1 root root 158 Jan 23 13:25 /etc/systemd/system/kend.service
    
CentOS stream 9, upgrade from v1.0.3 to v2.0.0
  • before install
     + ls -l /etc/init.d
     ls: cannot access '/etc/init.d': No such file or directory
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Jan  8 07:56 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v1.0.3
     sudo yum install kend-v1.0.3-0.el7.x86_64.rpm
     
     Installed:
       kend-v1.0.3-0.el7.x86_64
    
     + ls -l /etc/init.d
     total 12
     -rwxr-xr--. 1 root root 10157 Sep 26 06:18 kend
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Jan  8 07:56 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v2.0.0 - chkconfig install failed because /etc/init.d already exists; but kend was upgraded nevertheless.
     sudo yum install kend-v2.0.0-0.el9.x86_64.rpm
    
     error: unpacking of archive failed on file /etc/init.d;679253fc: cpio: File from package already exists as a directory in system
     error: chkconfig-1.24-1.el9.x86_64: install failed
    
     Upgraded:
       kend-v2.0.0-0.el9.x86_64
     Installed:
       initscripts-10.11.8-4.el9.x86_64
     Failed:
       chkconfig-1.24-1.el9.x86_64
    
     + ls -l /etc/init.d
     total 12
     lrwxrwxrwx. 1 root root    26 Jan 23 14:36 functions -> /etc/rc.d/init.d/functions
     -rwxr-xr--. 1 root root 10161 Jan 23 13:25 kend
     + ls -l /etc/rc.d/init.d
     total 24
     -rw-r--r--. 1 root root 18220 Aug 27 11:35 functions
     -rw-r--r--. 1 root root  1161 Jan  8 07:56 README
     + ls -l /etc/systemd/system/kend.service
     -rw-r--r--. 1 root root 158 Jan 23 13:25 /etc/systemd/system/kend.service
    
Rocky Linux 9, clean install v2.0.0
  • before install
     + ls -l /etc/init.d
     ls: cannot access '/etc/init.d': No such file or directory
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Nov 16 01:21 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v2.0.0
     sudo yum install kend-v2.0.0-0.el9.x86_64.rpm
    
     Installed:
       chkconfig-1.24-1.el9_5.1.x86_64    initscripts-10.11.7-1.el9.x86_64    kend-v2.0.0-0.el9.x86_64
    
     + ls -l /etc/init.d
     lrwxrwxrwx. 1 root root 11 Nov 12 10:43 /etc/init.d -> rc.d/init.d
     + ls -l /etc/rc.d/init.d
     total 36
     -rw-r--r--. 1 root root 18220 Mar  6  2024 functions
     -rwxr-xr--. 1 root root 10161 Jan 23 13:25 kend
     -rw-r--r--. 1 root root  1161 Nov 16 01:21 README
     + ls -l /etc/systemd/system/kend.service
     -rw-r--r--. 1 root root 158 Jan 23 13:25 /etc/systemd/system/kend.service
    
Rocky Linux 9, upgrade from v1.0.3 to v2.0.0
  • before install
     + ls -l /etc/init.d
     ls: cannot access '/etc/init.d': No such file or directory
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Nov 16 01:21 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v1.0.3
     sudo yum install kend-v1.0.3-0.el7.x86_64.rpm
     Installed:
       kend-v1.0.3-0.el7.x86_64
    
     + ls -l /etc/init.d
     total 12
     -rwxr-xr--. 1 root root 10157 Sep 26 06:18 kend
     + ls -l /etc/rc.d/init.d
     total 4
     -rw-r--r--. 1 root root 1161 Nov 16 01:21 README
     + ls -l '/etc/systemd/system/kend*'
     ls: cannot access '/etc/systemd/system/kend*': No such file or directory
    
  • after install v2.0.0 - chkconfig install failed because /etc/init.d already exists; but kend was upgraded nevertheless.
     sudo yum install kend-v2.0.0-0.el9.x86_64.rpm
    
     error: unpacking of archive failed on file /etc/init.d;6792568f: cpio: File from package already exists as a directory in system
     error: chkconfig-1.24-1.el9_5.1.x86_64: install failed
    
     Upgraded:
       kend-v2.0.0-0.el9.x86_64
     Installed:
       initscripts-10.11.7-1.el9.x86_64
     Failed:
       chkconfig-1.24-1.el9_5.1.x86_64
    
     + ls -l /etc/init.d
     total 12
     lrwxrwxrwx. 1 root root    26 Jan 23 14:47 functions -> /etc/rc.d/init.d/functions
     -rwxr-xr--. 1 root root 10161 Jan 23 13:25 kend
     + ls -l /etc/rc.d/init.d
     total 24
     -rw-r--r--. 1 root root 18220 Mar  6  2024 functions
     -rw-r--r--. 1 root root  1161 Nov 16 01:21 README
     + ls -l /etc/systemd/system/kend.service
     -rw-r--r--. 1 root root 158 Jan 23 13:25 /etc/systemd/system/kend.service
    

@blukat29 blukat29 marked this pull request as ready for review January 23, 2025 14:52
@blukat29 blukat29 requested a review from markyim-kaia February 3, 2025 00:28
@blukat29 blukat29 merged commit f713f14 into kaiachain:dev Feb 3, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants